class_name ButtonDemo
extends Button

func _init():
    _loadFont();
    self.text = "点击我"
    self.connect("pressed",self,"_btn_click");

func _loadFont():
    var dynamic_font = DynamicFont.new()
    dynamic_font.font_data = load("res://assets/fonts/FZKTK.TTF")
    dynamic_font.size = 32
    self.set("custom_fonts/font", dynamic_font);

func _btn_click():
    print("Btn click")